#define _CRT_SECURE_NO_WARNINGS
#include"stdio.h"
int print(int n) {
	if (n > 9) {
		return n % 10 + print(n / 10);
	}
	else
		return n;
}
int main() {
	int n;
	int sum = 0;
	scanf("%d", &n);
	int ref=print(n);
	printf("%d\n", ref);
	return 0;
}